<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jspf/links.jspf"%>
<script src="${pageContext.request.contextPath}/resources/js/users.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="company.admin.users" /></title>
</head>
<body>
	<div id="wrapper">
		<!-- header -->
		<div id="header">
			<%@ include file="/WEB-INF/jspf/header.jspf"%>
		</div>

		<!-- top menu -->
		<div id="menu">
			<%@ include file="/WEB-INF/jspf/menu.jspf"%>
		</div>

		<!-- bodywrap -->
		<div id="bodytop">&nbsp;</div>

		<div id="bodywrap">

			<div id="contentbody">
				<p>
					<spring:message code="company.admin.users" />
				</p>
				<hr>
				<table style="width: 100%; text-align: center; margin-bottom: 10px;">
					<thead>
						<tr>
							<th><spring:message code="company.admin.user.name" /></th>
							<th><spring:message code="company.admin.user.status" /></th>
							<th><spring:message code="company.admin.user.ban" /></th>
							<th><spring:message code="company.admin.user.remove" /></th>
						</tr>
					</thead>
					<tbody>
						<c:if test="${!empty users}">
							<c:forEach items="${users}" var="user">
								<tr>
									<td><a href="/company/pages/user/${user.username}"><c:out value="${user.username}" /></a></td>
									<c:choose>
										<c:when test="${user.enabled}">
											<td><spring:message
													code="company.admin.user.status.acticve" /></td>
										</c:when>
										<c:otherwise>
											<td><spring:message
													code="company.admin.user.status.banned" /></td>
										</c:otherwise>
									</c:choose>
									<td class="for-ban-unban"><input type="checkbox"
										name="ban" value="${user.id}"></td>
									<td class="for-remove"><input type="checkbox"
										name="remove" value="${user.id}"></td>
								</tr>
							</c:forEach>
						</c:if>
					</tbody>
				</table>
				<p style="text-align: right;">
					<spring:message code="company.admin.user.unban" var="unban" />
					<input type="button" id="unban" value="${unban}" />
					<spring:message code="company.admin.user.ban" var="ban" />
					<input type="button" id="ban" value="${ban}" />
					<spring:message code="company.admin.user.remove" var="remove" />
					<input type="button" id="remove" value="${remove}" />
				</p>
			</div>

		</div>
		<div id="bodybottom">&nbsp;</div>
		<div id="footer">
			<%@ include file="/WEB-INF/jspf/footer.jspf"%>
		</div>
		<div id="sidemenu">
			<div id="smtop">&nbsp;</div>
			<div id="smtitle">
				<h1>
					<spring:message code="company.menu" />
				</h1>
			</div>
			<ul class="normal">
				<li><a href="${pageContext.request.contextPath}/pages/routes"><spring:message
							code="company.menu.search" /></a></li>
				<li><a href="${pageContext.request.contextPath}/pages/cities"><spring:message
							code="company.menu.cities" /></a></li>
				<li><a href="${pageContext.request.contextPath}/pages/about"><spring:message
							code="company.menu.about" /></a></li>
			</ul>
			<div id="smtitle">
				<h1>
					<spring:message code="company.admin" />
				</h1>
			</div>
			<ul class="normal">
				<li><a href="${pageContext.request.contextPath}/pages/users"
					class="currentpage"><spring:message code="company.admin.users" /></a></li>
				<li><a href="${pageContext.request.contextPath}/pages/addUser"><spring:message
							code="company.admin.add.user" /></a></li>
			</ul>
			<div id="smbottom">&nbsp;</div>
		</div>
		<!-- end side menu -->
	</div>
	<!-- end wrapper -->

</body>
</html>